docs(hydrate): update SSG hydration guide to match the fixed pattern - #80
Merged
Conversation
The SSG page's client entry was showing the same buggy
`Effect.provide(App(), navLayer)` bake-in that this PR fixes in the
templates. The quick-start also incorrectly claimed SSG doesn't need
`Platform.makeClientLayer` — it does, both for NavigationContext and
so the stripped-loader routes can read window.__EFFEX_DATA__ / fetch
`?_data=1` on client-side nav.
Both pages now show `hydrate(App(), root, { layers: Platform.makeClientLayer(router) })`.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Deploying effex-api with
|
| Latest commit: |
01cf355
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5baa356e.effex-api.pages.dev |
| Branch Preview URL: | https://docs-hydrate-ssg-pattern.effex-api.pages.dev |
Deploying effex with
|
| Latest commit: |
01cf355
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8af15256.effex.pages.dev |
| Branch Preview URL: | https://docs-hydrate-ssg-pattern.effex.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #78 — the docs pages that describe client hydration were still showing the buggy
Effect.provide(App(), navLayer)bake-in this PR series fixed. Two content updates:apps/docs/content/06-platform/02-static-site-generation.md— swappedEffect.provide(App(), navLayer)forhydrate(App(), root, { layers: Platform.makeClientLayer(router) }), with a short note about why the bake-in kills scoped resources (popstate listener,SubscriptionRefPubSub).apps/docs/content/quick-start.md— corrected the "SSG doesn't needPlatform.makeClientLayer" claim. SSG needs it forNavigationContext(used byOutlet/Link) and forRouteDataProviderto surfacewindow.__EFFEX_DATA__/?_data=1HTML data — the Vite plugin strips loaders from the client bundle, so this provider is the only path data reaches routes after hydration.No code changes.
Test plan
06-platform/01-server-side-rendering.md(which already showed the correct pattern)🤖 Generated with Claude Code